let mixinList = require('../../common/mixinList')
Page({
    behaviors: [mixinList],
    data: {
        reqUrl: '/supplier/order/refund/index',
        tab_active: 0,
        scrollTop: 0,
        tabs: [{ title: '待处理' }, { title: '已处理' }]
    },
    onLoad: function(options) {
        const active = options.active
        if (active != undefined) this.setData({ tab_active: Number(active) })
        this.getList(true)
    },
    getParamsData() { //页面特殊的请求参数，需要时在页面内覆盖此方法，默认返回{}
        return { type: this.data.tab_active + 1, limit: 4 }
    },
    /**tabs切换事件 */
    onChange(event) {
        this.setData({ tab_active: event.detail.index, scrollTop: 0 })
        this.getList(true)
    },
    toDetail(e) {
        const { index } = e.detail
        wx.navigateTo({
            url: `/pages/after_sale_detail/index?refund_id=${this.data.list[index].refund_id}`
        })
    }
})